﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeviceCommon
{
    /// <summary>
    /// 设备状态更新事件
    /// </summary>
    public class DeviceStateChangedEventArgs : EventArgs
    {
        public readonly IDevice Device;
        public readonly DeviceState State;
        public readonly string Message;
        public DeviceStateChangedEventArgs(IDevice dev, DeviceState state, string message)
        {
            this.Device = dev;
            this.State = state;
            this.Message = message;
        }
    };

    /// <summary>
    /// 设备动作状态更新事件
    /// </summary>
    public class DeviceMsgResponsedEventArgs : EventArgs
    {
        public readonly ResponseMsgPackge Packge;
        public DeviceMsgResponsedEventArgs(ResponseMsgPackge packge)
        {
            this.Packge = packge;
        }
    };

    /// <summary>
    /// 设备任务超时事件
    /// </summary>
    public class DeviceActionTimeoutEventArgs : EventArgs
    {
        /// <summary>
        /// 设备动作执行超时的信息
        /// </summary>
        public readonly string Message;

        public DeviceActionTimeoutEventArgs(string msg)
        {
            this.Message = msg;
        }
    };

    /// <summary>
    /// 客户端信息包接收事件
    /// </summary>
    public class ClientPackageReceivedEventArgs : EventArgs
    {
        /// <summary>
        /// 接收到的信息包
        /// </summary>
        public readonly ResponseMsgPackge Package;
        public ClientPackageReceivedEventArgs(ResponseMsgPackge pack)
        {
            this.Package = pack;
        }
    };

    /// <summary>
    /// 客户端连接发生错误事件
    /// </summary>
    public class ClientErrorReportedEventArgs : EventArgs
    {
        /// <summary>
        /// 错误信息描述
        /// </summary>
        public readonly string Message;
        public ClientErrorReportedEventArgs(string msg)
        {
            this.Message = msg;
        }
    };   
}
